Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New resource: aws_dx_transit_virtual_interface #8522

Merged

Conversation

ewbankkit
Copy link
Contributor

@ewbankkit ewbankkit commented May 3, 2019

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" comments, they generate extra noise for pull request followers and do not help prioritize the request

Part of the work for #8490.
Replaces #8514.

Acceptance tests (requires an existing Direct Connect connection in available state):

$ DX_CONNECTION_ID=dxcon-aaaaaaaa make testacc TEST=./aws/ TESTARGS='-run=TestAccAwsDxTransitVirtualInterface_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -parallel 20 -run=TestAccAwsDxTransitVirtualInterface_ -timeout 120m
=== RUN   TestAccAwsDxTransitVirtualInterface_basic
=== PAUSE TestAccAwsDxTransitVirtualInterface_basic
=== CONT  TestAccAwsDxTransitVirtualInterface_basic
--- PASS: TestAccAwsDxTransitVirtualInterface_basic (1074.61s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	1074.672s

@ghost ghost added size/XL Managed by automation to categorize the size of a PR. documentation Introduces or discusses updates to documentation. provider Pertains to the provider itself, rather than any interaction with AWS. service/directconnect Issues and PRs that pertain to the directconnect service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels May 3, 2019
@ewbankkit ewbankkit force-pushed the issue-8490.dx_transit_virtual_interface branch 2 times, most recently from 0b33c48 to 55247fb Compare May 3, 2019 20:48
Copy link
Contributor

@n3ph n3ph left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MTU of a transit virtual interface is 8500 - Not 9001

* `id` - The ID of the virtual interface.
* `arn` - The ARN of the virtual interface.
* `aws_device` - The Direct Connect endpoint on which the virtual interface terminates.
* `jumbo_frame_capable` - Indicates whether jumbo frames (9001 MTU) are supported.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

9001 vs. 8500

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops, missed that one; Fixed.

@heycasey
Copy link

@ewbankkit Do you know what is preventing this from being merged? I'd love to have this resource available

@ewbankkit
Copy link
Contributor Author

@heycasey I'll fix the merge conflict.

@ewbankkit ewbankkit force-pushed the issue-8490.dx_transit_virtual_interface branch from c55e29f to 68c2994 Compare July 26, 2019 18:32
@ewbankkit
Copy link
Contributor Author

Rebased to fix merge conflict.
@n3ph Are there any more review comments to address?

Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ewbankkit 👋 Thanks for contributing this. Please see the below for some minor changes but otherwise good submission. Please reach out if you have any questions or do not have time to implement the feedback.

Since this Direct Connect resource testing requires a physical connection setup that the maintainers do not currently have access to, we can approve this pull request after the changes and two community acceptance test passing runs (one of these can be yours).

return err
}

return resourceAwsDxTransitVirtualInterfaceUpdate(d, meta)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since CreateTransitVirtualInterface can support tag-on-create and already handles MTU appropriately above, we should prefer to call Read after Create.

Suggested change
return resourceAwsDxTransitVirtualInterfaceUpdate(d, meta)
return resourceAwsDxTransitVirtualInterfaceRead(d, meta)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do.

return nil
}

func testAccCheckAwsDxTransitVirtualInterfaceExists(name string) resource.TestCheckFunc {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our testAccCheck...Exists() functions should be calling the API to verify the infrastructure exists as expected -- similar but opposite to the testAccCheckAwsDxTransitVirtualInterfaceDestroy function above. 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll do the same for other DX virtual interface resources in #9572.

website/docs/r/dx_transit_virtual_interface.html.markdown Outdated Show resolved Hide resolved
@bflad bflad added the waiting-response Maintainers are waiting on response from community or contributor. label Jul 29, 2019
@bflad bflad self-assigned this Jul 29, 2019
ewbankkit and others added 6 commits July 29, 2019 13:26
Co-Authored-By: Brian Flad <bflad417@gmail.com>
Error: error creating Direct Connect transit virtual interface: InvalidParameter: 1 validation error(s) found.
        - minimum field size of 1, CreateTransitVirtualInterfaceInput.NewTransitVirtualInterface.Tags.
@ewbankkit
Copy link
Contributor Author

@bflad Review comments addressed.
I also split the tagging acceptance tests from the other attribute acceptance tests which showed that the tests must be run serially, else you get the error:

error creating Direct Connect transit virtual interface: DirectConnectClientException: Only one Transit Virtual Interface is allowed on a Connection

Latest acceptance tests:

$ DX_CONNECTION_ID=dxcon-aaaaaaaa make testacc TEST=./aws/ TESTARGS='-run=TestAccAwsDxTransitVirtualInterface'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -parallel 20 -run=TestAccAwsDxTransitVirtualInterface -timeout 120m
=== RUN   TestAccAwsDxTransitVirtualInterface
=== RUN   TestAccAwsDxTransitVirtualInterface/basic
=== RUN   TestAccAwsDxTransitVirtualInterface/tags
--- PASS: TestAccAwsDxTransitVirtualInterface (1626.76s)
    --- PASS: TestAccAwsDxTransitVirtualInterface/basic (975.40s)
    --- PASS: TestAccAwsDxTransitVirtualInterface/tags (651.36s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	1626.831s

@bflad
Copy link
Contributor

bflad commented Jul 30, 2019

Awesome, thanks @ewbankkit. Updates look good. If another person can verify the acceptance testing also passes on their own Direct Connect connection and show the output here, we'll merge this in. 👍

@ewbankkit
Copy link
Contributor Author

One last change - Setting arn can be moved to the Read method now, removing duplicated code.

=== RUN   TestAccAwsDxTransitVirtualInterface/tags
    --- PASS: TestAccAwsDxTransitVirtualInterface/tags (514.06s)

@ghost ghost removed the waiting-response Maintainers are waiting on response from community or contributor. label Jul 31, 2019
@ewbankkit
Copy link
Contributor Author

ewbankkit commented Aug 2, 2019

Using common Exists and Destroy methods from #9572 in acceptance tests.
Acceptance tests:

$ DX_CONNECTION_ID=dxcon-aaaaaaaa make testacc TEST=./aws/ TESTARGS='-run=TestAccAwsDxTransitVirtualInterface'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -parallel 20 -run=TestAccAwsDxTransitVirtualInterface -timeout 120m
=== RUN   TestAccAwsDxTransitVirtualInterface
=== RUN   TestAccAwsDxTransitVirtualInterface/basic
=== RUN   TestAccAwsDxTransitVirtualInterface/tags
--- PASS: TestAccAwsDxTransitVirtualInterface (1584.46s)
    --- PASS: TestAccAwsDxTransitVirtualInterface/basic (942.27s)
    --- PASS: TestAccAwsDxTransitVirtualInterface/tags (642.19s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	1584.521s

@heycasey
Copy link

heycasey commented Aug 5, 2019

Is there anything I can do to help @bflad ? I saw that you were looking for another person to do acceptance testing, and I'd be happy to do that if I had documentation that describes how to do this. Ready to help to get this PR merged ASAP.

@ryno75
Copy link
Contributor

ryno75 commented Aug 6, 2019

@bflad I ran the acceptance test with my DX Connection and it seems to work as advertised (actual dxcon redacted)...

DX_CONNECTION_ID=dxcon-bbbbbbbb make testacc TEST=./aws/ TESTARGS='-run=TestAccAwsDxTransitVirtualInterface'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -parallel 20 -run=TestAccAwsDxTransitVirtualInterface -timeout 120m
=== RUN   TestAccAwsDxTransitVirtualInterface
=== RUN   TestAccAwsDxTransitVirtualInterface/basic
=== RUN   TestAccAwsDxTransitVirtualInterface/tags
--- PASS: TestAccAwsDxTransitVirtualInterface (1417.41s)
    --- PASS: TestAccAwsDxTransitVirtualInterface/basic (743.95s)
    --- PASS: TestAccAwsDxTransitVirtualInterface/tags (673.45s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	1417.971s

@bflad bflad added this to the v2.23.0 milestone Aug 6, 2019
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good and approving on two passing community acceptance testing runs! 🚀 Thanks so much @ewbankkit and @ryno75!

@bflad bflad merged commit 1406a50 into hashicorp:master Aug 6, 2019
bflad added a commit that referenced this pull request Aug 6, 2019
@ewbankkit ewbankkit deleted the issue-8490.dx_transit_virtual_interface branch August 7, 2019 11:56
@ghost
Copy link

ghost commented Aug 7, 2019

This has been released in version 2.23.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented Nov 2, 2019

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Nov 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Introduces or discusses updates to documentation. new-resource Introduces a new resource. provider Pertains to the provider itself, rather than any interaction with AWS. service/directconnect Issues and PRs that pertain to the directconnect service. size/XL Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants